package com.base.hong.ui.main.viewmodel

import androidx.lifecycle.MutableLiveData
import com.base.hong.model.BannerEntity
import com.htt.base_library.base.BaseVModel
import com.base.hong.repository.ZLRepository
import okhttp3.RequestBody


/**
 * @ClassName HomeViewModel
 * @Author Hong
 * @Date 2022/2/22 10:28
 * @Version 1.0
 */
class HomeViewModel : BaseVModel() {

    val homeData: MutableLiveData<String> = MutableLiveData()
    val bannerData: MutableLiveData<List<BannerEntity>> = MutableLiveData()
    private val repository: ZLRepository by lazy {
        ZLRepository()
    }

    fun getHomeData(body: RequestBody) {

    }

    fun getBannerInfo() {
        launch({
            repository.getBannerInfo()
        }, { bean ->
            bannerData.value = bean.data
        }, isShowDialog = false)
    }

}